package com.xiaoshuidi.cloud.framework.sms.core.client.impl.yunpian;

import com.xiaoshuidi.cloud.framework.common.exception.ErrorCode;
import com.xiaoshuidi.cloud.framework.common.exception.enums.GlobalErrorCodeConstants;
import com.xiaoshuidi.cloud.framework.sms.core.client.SmsCodeMapping;
import com.xiaoshuidi.cloud.framework.sms.core.enums.SmsFrameworkErrorCodeConstants;

public class YunpianSmsCodeMapping implements SmsCodeMapping {
    @Override
    public ErrorCode apply(String s) {
        switch (s) {
            case "0":
                return GlobalErrorCodeConstants.SUCCESS;
            case "1":
                return SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR;
            case "56":
                return SmsFrameworkErrorCodeConstants.SMS_MOBILE_INVALID;
            case "3":
                return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH;
            case "15":
                return SmsFrameworkErrorCodeConstants.SMS_SIGN_INVALID;
            case "11":
                return SmsFrameworkErrorCodeConstants.SMS_SEND_BUSINESS_LIMIT_CONTROL;
            case "7":
                return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR;
            default:
                return SmsFrameworkErrorCodeConstants.EXCEPTION;
        }

    }
}
